# modules/squid/manifests/init.pp - manage squid stuff
# Copyright (C) 2007 admin@immerda.ch
#

# modules_dir { "at3_proxy": }

import "squid"

class at3_proxy inherits squid {
  
  # call this with appropriate parameters to define squid.conf
  define squid_conf( $visible_hostname = $fqdn,
  $cache_size = "256", $squiddir = $squiddir) {
    file { "/etc/squid/squid.conf":
      path => "/etc/squid/squid.conf",      
      ensure => file,
      owner => root,
      group => root,
      mode => 644,
      content => template("at3_proxy/squid.conf/MASTER.erb"),
      require => Package["squid"],
      notify => Service[squid],      
    }
  }

  at3_proxy::squid_conf {"helloProxy":cache_size => 512}
  set_role_attr($webaddr,$roleid,"ProfileApplied","True")
  set_role_attr($webaddr,$roleid,"SquidProxy","http://$ipaddress:3128/")
  set_role_attr($webaddr,$roleid,"NFSClient","$ipaddress")

}
